package com.kaigejava.factorypattern.method;

import com.kaigejava.factorypattern.method.domain.BeiJinGreekPizza;
import com.kaigejava.factorypattern.method.domain.BeiJinPepperPizza;

/**
 * Created by kaigejava on 2019/8/25.
 * 来自北京的披萨订单
 */
public class BeiJinOrderPizza extends  PizzaOrderAbstract{
    @Override
    protected PizzaAbstract createPizza(String ordertype) {
        PizzaAbstract pizza = null;
        if (ordertype.equals("greek")) {
            pizza = new BeiJinGreekPizza();
        } else if (ordertype.equals("pepper")) {
            pizza = new BeiJinPepperPizza();
        }else if(ordertype.equals("over")){
            System.out.println("****欢迎下次光临****");
        }else{
            System.out.println("您输入的有误，请重新输入");
        }
        return pizza;
    }
}
